package com.vs.dao;

import javax.sql.DataSource;

import org.apache.log4j.Logger;
import org.springframework.jdbc.core.JdbcTemplate;

public class TestDao {
	private static final Logger log = Logger.getLogger(TestDao.class);
	
	private JdbcTemplate jdbcTemplate;
	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}
	
	public int getPersonNum(){
		log.info("getPersonNum method");
		int queryForInt = jdbcTemplate.queryForInt("select count(*) from person");
		return queryForInt;
	}
}
